﻿using IdeaBlade.EntityModel;

namespace SWTORLogDb.Entities
{
    /// <summary>
    /// Helper class to encapsulate actions that can be performed on a DevForce Entity through its EntityAspect
    /// </summary>
    public class EntityActions
    {
        private readonly EntityAspect _entityAspect;

        /// <summary>
        /// Initializes a new instance of the <see cref="EntityActions" /> class.
        /// </summary>
        /// <param name="entity">The entity.</param>
        public EntityActions(object entity)
        {
            _entityAspect = EntityAspect.Wrap(entity);
        }

        /// <summary>
        /// Rejects the changes.
        /// </summary>
        public void RejectChanges()
        {
            _entityAspect.RejectChanges();
        }

        /// <summary>
        /// Deletes this instance.
        /// </summary>
        public void Delete()
        {
            _entityAspect.Delete();
        }
    }
}
